package com.camel.base.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.camel.base.model.TbDictValue;
import com.camel.base.model.TbMockRequest;
import com.camel.base.model.TbMockResponse;
import com.camel.base.service.TbMockRequestService;
import com.camel.core.controller.BaseCommonController;
import com.camel.core.model.SysUser;
import com.camel.core.service.BaseCommonService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/mockReq")
public class TbMockRequestController extends BaseCommonController<TbMockRequest> {

    @Resource
    private TbMockRequestService<TbMockRequest> service;

    @Override
    public boolean exist(TbMockRequest entity) {
        return service.count(new QueryWrapper<TbMockRequest>()
                .eq("mock_addr", entity.getMockAddr())) > 0;
    }

    @Override
    public BaseCommonService<TbMockRequest> getiService() {
        return service;
    }

    @Override
    public String getMouduleName() {
        return "mock请求";
    }
}
